using System;
using InfoTech.Mvc.Core.Models;
using InfoTech.Utilities.Reflection;
using System.ComponentModel.DataAnnotations;
using InfoTech.Mvc.Core.UI.Validation;
using InfoTech.LanTranh.MucVu.Bussiness;

namespace InfoTech.Mvc.LanTranh.MucVu.Models
{
    [Serializable]
    public partial class TINHTHANHModel : ObjModel<TINHTHANH>, IModelConverter
    {

        #region Constructor

        public TINHTHANHModel()
            : base()
        {
        }

        public TINHTHANHModel(TINHTHANH obj)
            : base(obj)
        {
        }

        #endregion

        #region Fields

        private System.Guid? _matinhthanh;

        private System.Guid? _maquocgia;

        private System.String _tentinhthanh;

        private System.String _mabuuchinh;

        private System.Boolean _isdata;

        private System.Boolean _isdefault;

        #endregion

        #region Properties

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Guid? MATINHTHANH
        {
            get
            {
                return _matinhthanh;
            }
            set
            {
                _matinhthanh = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Guid? MAQUOCGIA
        {
            get
            {
                return _maquocgia;
            }
            set
            {
                _maquocgia = value;
            }
        }

        //[Store]
        [Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        [StringLength(1000, ErrorMessage = "Value must be under 1000 characters")]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.String TENTINHTHANH
        {
            get
            {
                return _tentinhthanh;
            }
            set
            {
                _tentinhthanh = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        [StringLength(100, ErrorMessage = "Value must be under 100 characters")]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.String MABUUCHINH
        {
            get
            {
                return _mabuuchinh;
            }
            set
            {
                _mabuuchinh = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Boolean ISDATA
        {
            get
            {
                return _isdata;
            }
            set
            {
                _isdata = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Boolean ISDEFAULT
        {
            get
            {
                return _isdefault;
            }
            set
            {
                _isdefault = value;
            }
        }

        #endregion

        #region IModelConverter

        public System.Type Reflector()
        {
            return typeof(TINHTHANHModel);
        }
        public object GetModel()
        {
            return this;
        }

        #endregion

        #region Overrides of Model<TINHTHANH>

        public override void ReverttoModel()
        {
            CreateModel(this);
        }

        public override TINHTHANH ReverttoBussiness()
        {
            return CreateBussiness(this);
        }

        #endregion

        #region Operators

        public static implicit operator TINHTHANHModel(TINHTHANH obj)
        {
            return new TINHTHANHModel(obj);
        }
        public static implicit operator TINHTHANH(TINHTHANHModel obj)
        {
            return obj.ReverttoBussiness();
        }

        #endregion

    }
}
